Groups

interface Groups

This module provides methods for managing groups of contacts within the Rainbow environment.

In Rainbow, a group represents a list of contacts that users can create and manage according to their needs. The Groups interface offers functionality to interact with these groups, allowing users to retrieve, create, delete, and modify groups, as well as manage the members within these groups.

This interface can be used to:

  • Retrieve groups: Access a list of existing groups created by the user.

  • Create new groups: Define and establish new groups of contacts for easier management and communication.

  • Delete groups: Remove groups that are no longer needed or relevant.

  • Modify group details: Update the attributes of a group, such as its name or description.

  • Manage group members: Add or remove contacts from a group, ensuring that the group membership stays up-to-date.

Detailed information about each group is available through the Group object, which encapsulates all relevant data for individual groups, including member lists and group properties.

Samples

com.ale.rainbowsdk.samples.GroupsSample

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val groups: ArrayItemList<Group>

Retrieves the user's groups.

Functions

Link copied to clipboard
abstract fun addContactsToGroup(groupId: String?, contactIds: List<String?>, listener: RainbowListener<Unit, List<RainbowError<Unit>>>? = null)

Adds multiple contacts to a specific group.

Link copied to clipboard
abstract fun addContactToGroup(groupId: String?, contactId: String?, listener: RainbowListener<Unit, Unit>?)

Adds a contact to a specific group.

Link copied to clipboard
abstract fun createGroup(    @Size(min = 0, max = 255) name: String?,     @Size(min = 0, max = 255) description: String?,     listener: RainbowListener<Group, Unit>? = null)

Creates a new group with the specified name and description.

Link copied to clipboard
abstract fun deleteContactFromGroup(groupId: String?, contactId: String?, listener: RainbowListener<Unit, Unit>?)

Removes a contact from a specific group.

Link copied to clipboard
abstract fun deleteContactsFromGroup(    groupId: String?,     contactIds: List<String?>,     listener: RainbowListener<Unit, List<RainbowError<Unit>>>? = null)

Removes multiple contacts from a specific group.

Link copied to clipboard
abstract fun deleteGroup(groupId: String?, listener: RainbowListener<Unit, Unit>? = null)

Deletes a group by its unique ID.

Link copied to clipboard
abstract fun fetchGroupById(groupId: String?, listener: RainbowListener<Group, Unit>? = null)

Fetches a group by its unique ID.

Link copied to clipboard
abstract fun fetchGroups(offset: Int = 0, limit: Int = DEFAULT_LIMIT_FETCH_GROUPS, listener: RainbowListener<List<Group>, Unit>? = null)

Fetches all groups for the user.

Link copied to clipboard
abstract fun findGroupById(groupId: String?): Group?

Finds and retrieves a group by its unique ID.

Link copied to clipboard
abstract fun findGroupByName(groupName: String?): Group?

Finds and retrieves a group by its name.

Link copied to clipboard
abstract fun updateGroup(    groupId: String?,     @Size(min = 0, max = 255) name: String?,     @Size(min = 0, max = 255) description: String?,     listener: RainbowListener<Group, Unit>?)

Updates the details of an existing group.